<!DOCTYPE html>
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<html>
<!--<![endif]-->
<head>
<base target="_self" />
<%@ include file="/common/meta.jsp"%>
<%@ include file="/common/jqGridHead.jsp"%>
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
<%-- <link rel="stylesheet" type="text/css" href="${ctx }/styles/common.css"/> --%>
<title></title>
</head>
<body>
	<form id="mainForm"  role="form" method="get">
		<div class="breadcrumb form-search" style="background-color: #f5f5f5;">
			<div>
				<label>关键字:</label>
				<input type="text"  name="filter_LIKES_name_OR_partName_OR_remark" placeholder="名称或编码相关关键字"  value="${name}"/>
					<button id="btnSearch" name="btnSearch" type="submit" class="btn btn-primary" onclick="queryForGrid('mainForm','jqGrid');return false">查询</button>
					<button id="btnReset" name="btnReset" type="button" class="btn btn-primary" onclick="reset();">重置</button>
			</div>
		</div>
	</form>
	<table id="jqGrid"></table>
	<div id="jqGridPager"></div>
	<script type="text/javascript">
		$(document).ready(function()
		{
			var jqgridH = 400;
			$("#jqGrid").jqGrid(
			{ url : '${ctx}/banner/list.do',
			  mtype : "GET",
			  datatype : "json",
			  page : 1,
			  viewrecords: true,
			  colModel :
			[
					{ label : "操作", name : "id", formatter : function(cellValue, options, rowObject)
					{return "<a href='${ctx}/banner!input.action?id=" + cellValue + "' class='underline'><i class='glyphicon glyphicon-edit'></i>修改</a>";},
					  width : 70,   align : 'center', sortable : false, search : false },
					{ label : '名称', name : 'name', align : 'center', width : 150},
					{ label : '链接', name : 'part', align : 'center', width : 450},
					{ label : '排序', name : 'sort', align : 'center', width : 120},
					{ label : '上传人', name : 'uploadPerson', align : 'center', width : 180 },
					{ label : '是否显示', name : 'isShow', align : 'center', width : 100 },
					{ label : '备注', name : 'remark', align : 'center', width : 100}
			], autowidth : true, height : jqgridH,scrollOffset:0, shrinkToFit : 400, rowNum : 2, viewrecords : true, rownumbers : true,
			jsonReader:{
    			root: "result",
    			page: "currentPage",
    			total: "totalPages",
    			records: "totalCount",
    			repeatitems: true,
    			cell: "cell",
    			id: "id",
    			userdata: "userdata",
    			subgrid: {root:"results", repeatitems: true, cell:"cell"}
    		},
    		prmNames: {
				page:"pageNo",
				rows:"pageSize",
				sort: "orderBy",
				order: "order",
				search:"_search",
				nd:"nd", id:"id",
				oper:"oper",
				editoper:"edit",
				addoper:"add",
				deloper:"del",
				subgridid:"id",
				npage: null,
				totalrows:"totalCounts"
			}, 
			rowList :[2, 3,4], 
			pager : "#jqGridPager"
			});
			
			 $('#jqGrid').navGrid("#jqGridPager", {                
	                search: true, // show search button on the toolbar
	                searchtext:'搜索',
	                add: false,
	                edit: false,
	                del: false,
	                refresh: true,
	                refreshtext:'刷新'
	            },
	            {}, // edit options
	            {}, // add options
	            {}, // delete options
	            { multipleSearch: true,multipleGroup: true} // search options - define multiple search
	            );

			$("#jqGrid").jqGrid('setGroupHeaders',
			{ useColSpanStyle : true, // 没有表头的列是否与表头列位置的空单元格合并
				});
			
			$('#jqGrid').navButtonAdd('#jqGridPager', {
				buttonicon : "glyphicon-excel",
				title : "导出数据",
				caption : "导出",
				position : "last",
				onClickButton : function() {
					$("#jqGrid").jqGrid('excelExport',{title:'道路清单'});
				}
			});
			$('#jqGrid').navButtonAdd('#jqGridPager',
					{ buttonicon : "glyphicon-count", title : "分组统计图表", caption : "分组统计", position : "last", onClickButton : function()
					{
						$("#jqGrid").jqGrid('setColumnstotal');
					} });
			$("#searchmodfbox_jqGrid").css("width", "660px");
		});
	</script>


</body>
